<template>
  <div className="my">
    <NavBar title="我的订单"></NavBar>
    <van-tabs v-model:active="active">
      <van-tab :title="item.title" :key="index" v-for="(item,index) in list" :name="item.name">
        <scroll-item :status="item.name" />
      </van-tab>
    </van-tabs>
  </div>
</template>

<script setup>
import {reactive, onMounted, ref, defineComponent} from 'vue'
import NavBar from "@/components/NavBar/index.vue"
import {useRoute} from "vue-router";
import ScrollItem from "./components/ScrollItem/index.vue"
const active = ref(0);
const list = ref([
  {
    title: "全部",
    name: "0"
  },
  {
    title: "已提交",
    name: "1"
  },
  {
    title: "已审核",
    name: "2"
  },
  {
    title: "已发货",
    name: "3"
  },
  {
    title: "已完成",
    name: "4"
  },
])
const route = useRoute()
onMounted(() => {
  // active=route.params.status
  active.value = route.params.status
  console.log(`the component is now mounted.`, route.params.status)
})

</script>

<style lang="less" scoped>

</style>